﻿using System;
using SportTraining.Core.Domain;

namespace SportTraining.MVVM.Model.Impl
{
    /// <summary>
    ///  класс для сохранения информации о транзакции
    /// </summary>
    public class TransactionInfo
    {
        public TransactionInfo(IPayment payment, TransactionState state)
        {
            State = state;
            PriceId = payment.Price.Id;
            FeeMoney = payment.FeeMoney;
            PaymentDate = payment.PaymentDate;
            SubscriptionDate = payment.SubscriptionDate;
        }

        public TransactionInfo()
        {
        }

        public TransactionState State { get; set; }

        public int PriceId { get; set; }

        public int FeeMoney { get; set; }

        public DateTime PaymentDate { get; set; }

        public DateTime SubscriptionDate { get; set; }

        public void UpdateInfo(IPayment payment, TransactionState state)
        {
            State = state;
            PriceId = payment.Price.Id;
            FeeMoney = payment.FeeMoney;
            PaymentDate = payment.PaymentDate;
            SubscriptionDate = payment.SubscriptionDate;
        }
    }
}